home *** CD-ROM | disk | FTP | other *** search
- Path: solon.com!not-for-mail
- From: seebs@solutions.solon.com (Peter Seebach)
- Newsgroups: comp.lang.c
- Subject: Re: Determining the length of an int in string form
- Date: 29 Mar 1996 21:37:25 -0600
- Organization: Usenet Fact Police (Undercover)
- Message-ID: <4jia9l$81e@solutions.solon.com>
- References: <3156D7BD.90D@oc.com> <828141352snz@genesis.demon.co.uk>
- NNTP-Posting-Host: solutions.solon.com
-
- In article <828141352snz@genesis.demon.co.uk>,
- Lawrence Kirby <fred@genesis.demon.co.uk> wrote:
- [re:]
- >>Do implementations of snprintf() exist today that could be held up
- >>as prior-art?
-
- >I don't know of any offhand.
-
- BSD 4.4 or so (maybe later, it's NetBSD) has snprintf and vsnprintf.
- There are *not* fnprintf/nprintf. Their semantics are that they write
- at most (size - 1) bytes into the given buffer, and NUL terminate it.
- If the return value is >= the size argument, the string was too short,
- "and some of the printed characters were discarded". It is not specified
- that it tells you how short you were.
-
- Arguably, not part of C, but discussions of possible future standardization
- are vaguely topical.
-
- It's a great feature, and I'd use it heavily if it were part of the
- language.
-
- -s
- --
- Peter Seebach - seebs@solon.com - Copyright 1996 Peter Seebach.
- C/Unix wizard -- C/Unix questions? Send mail for help. No, really!
- FUCK the communications decency act. Goddamned government. [literally.]
- The *other* C FAQ - http://www.solon.com/~seebs/c/c-iaq.html
-